import { pubRequire, downFile } from '@utils/public.js'

// 实物订单列表
export function physicalOrdersList(obj, sucBack, errBack) {
  pubRequire('get', '/marketing/prize-orders', obj, sucBack, errBack)
}
// 编辑实物奖品订单

export function editAwardOrders(id, obj, sucBack, errBack) {
  pubRequire('put', `/marketing/prize-orders/${id}`, obj, sucBack, errBack)
}

// 发货
export function postGoods(id, obj, sucBack, errBack) {
  pubRequire(
    'put',
    `/marketing/prize-orders/${id}/shipments`,
    obj,
    sucBack,
    errBack
  )
}

// 实物奖品订单列表导入
export function importUrlOrderList() {
  return `/marketing/prize-orders/import`
}
// 实物奖品订单列表导出
export function exportOrderList() {
 return `/marketing/prize-orders/export`
}

// 抽奖明细列表
export function awardDrawList(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/lotteries/${activityId}`,
    obj,
    sucBack,
    errBack
  )
}

// 抽奖明细列表导出
export function exportAwardList(activityId, obj, title, errBack) {
  downFile(
    'get',
    `/activities/lotteries/${activityId}/export`,
    obj,
    title,
    errBack
  )
}

// 根据id查询抽奖明细

export function lotteriesList(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/lotteries/${activityId}/details`,
    obj,
    sucBack,
    errBack
  )
}
// 活动列表

export function activeLists(obj, sucBack, errBack) {
  pubRequire('get', '/marketing/activity', obj, sucBack, errBack)
}
// 结束营销活动接口
export function endingActive(id, obj, sucBack, errBack) {
  pubRequire('put', `/marketing/activity/${id}/over`, obj, sucBack, errBack)
}
// 删除营销活动接口
export function deleteActive(id, obj, sucBack, errBack) {
  pubRequire('delete', `/marketing/activity/${id}`, obj, sucBack, errBack)
}
// 新增营销活动接口
export function addActives(obj, sucBack, errBack) {
  pubRequire('post', '/marketing/activity', obj, sucBack, errBack)
}
// 修改营销活动接口
export function changeActives(id, obj, sucBack, errBack) {
  pubRequire('put', `/marketing/activity/${id}`, obj, sucBack, errBack)
}
// 优惠券列表

export function couList(obj, sucBack, errBack) {
  pubRequire('get', '/coupons', obj, sucBack, errBack)
}
// 根据参数配置key获取value
export function maxNum(obj, sucBack, errBack) {
  pubRequire('get', '/system/parameters/options', obj, sucBack, errBack)
}

// 根据参数配置key获取value
export function getCommUrl(obj, sucBack, errBack) {
  pubRequire('get', '/system/parameters/options', obj, sucBack, errBack)
}

// 活动概述曲线图
export function summaries(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/summaries/${activityId}/chats`,
    obj,
    sucBack,
    errBack
  )
}

// 邀请活动数据详情
export function invitedDetails(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/summaries/${activityId}/data`,
    obj,
    sucBack,
    errBack
  )
}
// 邀请活动列表
export function invitedList(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/summaries/${activityId}/data-list`,
    obj,
    sucBack,
    errBack
  )
}
// 活动概述数据
export function activeShow(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/summaries/${activityId}/statistics/details`,
    obj,
    sucBack,
    errBack
  )
}
// 邀请活动列表--查看功能
export function viewData(activityId, obj, sucBack, errBack) {
  pubRequire(
    'get',
    `/activities/summaries/${activityId}/data-list/details`,
    obj,
    sucBack,
    errBack
  )
}
// 邀请活动导出列表
export function exportInvitedData(activityId) {
  return `/activities/summaries/${activityId}/data-list/export`
  // pubRequire('get', `/activities/summaries/${activityId}/data-list/export`, obj,sucBack, errBack)
}
// 营销邀请活动详情
export function invitedActiveDetail(id, obj, sucBack, errBack) {
  // return `/activities/summaries/${activityId}/data-list/export`
  pubRequire(
    'get',
    `/marketing/invite-activity/${id}/info`,
    obj,
    sucBack,
    errBack
  )
}
// 营销抽奖活动详情
export function lotteryActiveDetail(id, obj, sucBack, errBack) {
  // return `/activities/summaries/${activityId}/data-list/export`
  pubRequire(
    'get',
    `/marketing/lottery-activity/${id}/info`,
    obj,
    sucBack,
    errBack
  )
}
// 按照id查询营销活动接口
export function searchActive(id, obj, sucBack, errBack) {
  // return `/activities/summaries/${activityId}/data-list/export`
  pubRequire('get', `/marketing/activity/${id}`, obj, sucBack, errBack)
}
